Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@internationalized/message

Package Overview
Dependencies
Maintainers
2
Versions
767
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internationalized/message

Internationalized message formatting and locale negotiation

  • 3.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-6.78%
Maintainers
2
Weekly downloads
 
Created

What is @internationalized/message?

@internationalized/message is a JavaScript library designed to facilitate internationalization (i18n) by providing tools for message formatting. It allows developers to create localized messages with support for pluralization, gender, and other language-specific variations.

What are @internationalized/message's main functionalities?

Basic Message Formatting

This feature allows you to format basic messages with placeholders that can be replaced with dynamic values.

const { MessageFormatter } = require('@internationalized/message');
const formatter = new MessageFormatter('en-US');
const message = formatter.format('Hello, {name}!', { name: 'John' });
console.log(message); // Output: Hello, John!

Pluralization

This feature supports pluralization, allowing messages to change based on the quantity of items.

const { MessageFormatter } = require('@internationalized/message');
const formatter = new MessageFormatter('en-US');
const message = formatter.format('{count, plural, one {# item} other {# items}}', { count: 5 });
console.log(message); // Output: 5 items

Gender-Specific Messages

This feature allows you to create gender-specific messages, which can be useful for languages that have gendered nouns and pronouns.

const { MessageFormatter } = require('@internationalized/message');
const formatter = new MessageFormatter('en-US');
const message = formatter.format('{gender, select, male {He} female {She} other {They}} is a developer.', { gender: 'female' });
console.log(message); // Output: She is a developer.

Other packages similar to @internationalized/message

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc